<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //对象自变量的方式创建一个car
        // var car={
        //     color:'red',
        // };
        // console.log(car);

        //object函数构建的
        // var car = new Object();
        // car.color='red'; 
        // car.height=1.8;
        // console.log(car);

        function Factory(color, height, suv) {
            this.color = color;
            this.height = height;
            this.suv = suv;
        }
        var car1 = new Factory('red', 1.8, true);
        console.log(car1);
    </script>
</body>
</html>